package com.authstr;

import com.authstr.utils.SerializableUtils;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;


/**
 * servle的启动类,在tomcat启动时,启动spring boot
 * @tame 2018年10月11日10:07:15
 * @author authstr
 */
public class ServletInit extends SpringBootServletInitializer {

	@Override
	protected SpringApplicationBuilder configure(
			SpringApplicationBuilder builder) {
//		System.out.println("------------------------启动Tomcat------------------------------");
//
//		System.out.println("------------------------正在载入设置文件...------------------------------");
//		try {
////			HttpClientUtils.cookieStore=(CookieStore) SerializableUtils.readObjectFromFile("client_cookie.dat");
//			Setting setting=(Setting) SerializableUtils.readObjectFromFile("setting_object.dat");
//			SettingUtils.setCurrSetting(setting);
//			System.out.println("------------------------载入设置文件成功------------------------------");
//		} catch (Exception e) {
//			e.printStackTrace();
//			for(int i=0;i<60;i++){
//				System.out.println("------------------------载入设置文件失败------------------------------");
//			}
//		}
		return builder.sources(ApplicationInit.class);
	}

}
